<?php $current_url = $this->id.'/'.$this->action->id;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php if($this->route!='search/index'&& $this->route!='site/index'):?>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/columns.css" rel="stylesheet" type="text/css" />
<?php endif;?>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" rel="stylesheet" type="text/css" />
<?php if(Yii::app()->user->isGuest||$this->route=='site/index'||$this->route=='search/index'):?>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/master.css" rel="stylesheet" type="text/css" />
<?php endif;?>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/public.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.form.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/validate.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/utils.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.cookie.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/PIE.js"></script>
<![endif]--> 
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>
<div id='showmsg' style="display: none">
<div class="mask"></div>
<div class="dialog">
<div class="dia_title"><p>温馨提示</p></div><div class="dia_con"><p id='topmsg'></p></div>
</div>
</div>
<?php if(!Yii::app()->user->isGuest&&$this->route!='site/index'):?>
<?php
$tendency = UserSetting::model()->findByPk(Yii::app()->user->id);
$url="&UserSetting[sex_tendency]=$tendency->sex_tendency&UserSetting[age_start]=$tendency->age_start&UserSetting[age_end]=$tendency->age_end&UserSetting[citys_tendency]=$tendency->citys_tendency&UserSetting[edu_tendency]=$tendency->edu_tendency&UserSetting[income_tendency]=$tendency->income_tendency&UserSetting[height]=$tendency->height";
$pm_nums = Pm::model()->countBySql(' select count(*) from pm_messages where  to_uid=? AND is_read=? AND `status`=? AND del_status_sec=? ',array(Yii::app()->user->id,Pm::PM_READ_STATUS_NO,Pm::PM_STATUS_OK,Pm::PM_DEL_NORMAL));
?>
<div class="header">
      <div class="warpper">
            <div class="left"> <a href="?r=home" title="之嗅交友站"><img src="images/small_logo.jpg" width="120" height="39" alt="之嗅交友站" class="logo"/></a>
                  <ul>
                        <li><a id="zcenter" href="?r=home/index" title="个人中心" class="topl">个人中心</a></li>
                        <li><a target="_BLACK" href="?r=space/index" title="我的空间" class="topl">我的空间</a></li>
                        <li><a href="?r=search/index<?php echo $url;?>" title="查找朋友" class="topl">查找朋友</a></li>
                  </ul>
            </div>
            <div class="right">
                  <ul>
                        <li><span class="user"><?php echo @CHtml::link(CHtml::encode(Yii::app()->user->nickname),array('space/index'),array('style'=>'color: #FFCC00'));?></span></li>
                        <?php if($pm_nums):?><li>收信箱<span class="letters_num"><?php echo CHtml::link('（'.$pm_nums.'）',array('pm/inbox','isread'=>Pm::PM_READ_STATUS_NO,'c'=>2));?></span></li><?php endif;?>
                        <li><span class="set">个人设置</span>
                        <!--[if IE 6]><iframe></iframe><![endif]-->
                              <ul>
                                    <li><a href="?r=tags" title="标签管理">标签管理</a></li>
                                    <li><a href="?r=tags&type=1" title="排斥标签">排斥标签</a></li>
                                    <li><a href="?r=pic/upload" title="添加照片">添加照片</a></li>
                                    <li><a href="?r=post/new" title="写新日志">写新日志</a></li>
                                    <li><a href="?r=home/intro" title="定义资料">定义资料</a></li>
                                    <li><a href="?r=home/profile" title="个人介绍">个人介绍</a></li>
                              </ul>
                        </li>
                        <li><span class="out"><a href="?r=site/logout" title="退出">退出</a></span></li>
                  </ul>
            </div>
      </div>
</div>
<?php else:?>
<?php if($this->route!='site/index'):?>
<div class="header">
  <div class="warpper">
    <div class="left"> <a href="?r=site" title="之嗅交友站"><img src="images/small_logo.jpg" width="120" height="39" alt="之嗅交友站" class="logo"/></a> 
    </div>
    <div class="regist">
      <ul>
        <li><a href="?r=site/regist" title="注册">注册</a></li>
        <li class="login"><a href="javascript:void(0)" title="登陆">登陆</a> </li>
      </ul>
      <div class="login_in">
        <form class="loginform1" action="?r=site/login" method="post">
          <div class="text"> <span>
            <label>邮箱</label>
            <input type="text" name="username" class="user_name"/>
          </span> <span>
          <label>密码</label>
          <input type="password" name="password" class="user_pass"/>
        </span> </div>
        <div id='msg1'></div>
        <div class="action"> <span>
          <input type="submit" name="submit" class="submit" value="登陆"/>
        </span><span>
        <input type="checkbox" checked="checked" name="rememberMe" class="checkbox"/>
      </span> <span><a href="#" title="一个月内免登陆">一个月内免登陆</a></span> </div>
    </form>
  </div>
</div>
</div>
</div>
<?php endif;?>     
<?php endif;?>
<?php echo $content; ?>
<!--footer-->
<div class="warpper">
      <div class="footer">
            <div class="bottom">
                  <div class="leftbar">
                        <ul class="left">
                              <li><img src="images/about.jpg" width="22" height="22" align='absmiddle' alt="关于之嗅"/><a href="#" title="关于之嗅">关于之嗅</a></li>
                              <li><img src="images/job.jpg" width="22" height="22" align='absmiddle' alt="免责声明"/><a href="#" title="免责声明">免责声明</a></li>
                              <li><img src="images/email.jpg" width="22" height="22" align='absmiddle' alt="联系我们"/><a href="mailto:a@zcou.com" title="联系我们">联系我们</a></li>  
                        </ul>
                  </div>
                  <div class="rightbar">
                        <ul class="right">
                              <li><img src="images/QQ.jpg" width="22" height="22" align='absmiddle' alt="QQ群"/><a href="#" title="群：218605715">群：218605715</a></li>
                              <li><img src="images/sina.jpg" width="22" height="22" align='absmiddle' alt="新浪微博"/><a target="_BLACK" href="http://weibo.com/zcou" title="新浪微博">新浪微博</a></li>
                              <li><img src="images/question.jpg" width="22" height="22" align='absmiddle' alt="问题中心"/><a href="#" title="问题中心">问题中心</a></li>
                        </ul>
                  </div>
            </div>
            <div class="copyright">CopyRight © 2012 Zcou.com all Rights Reserved.</div>
      </div>
</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
      //设置当前导航菜单
      var controller = '<?php echo $this->id,"/",$this->action->id; ?>';
      var counter = 0;
      $('.topl').removeClass('hover').each(function(){
        if($(this).attr('href')=='?r='+controller){
            $(this).addClass('hover');
            counter =1;
        }
      });
      if(counter===0)$('#zcenter').addClass('hover');


// prepare Options Object 
var optionsa = { 
    target:     '#msg1', 
    // url:        'comment.php', 
    success:   function(data) { 
        if(data=='ok'){
            window.location.href="?r=home"; 
        }
    } 
}; 
 
// pass options to ajaxForm 
$('.loginform1').ajaxForm(optionsa);
   
})
</script>